CC = g++
DEBUG = -g
CFLAGS = -Wall -c $(DEBUG)
LFLAGS= -Wall $(DEBUG) -lgtest
PROFILER = -lprofiler -L/usr/local/lib

all: main test fast

custom_sp.o: custom_sp.cpp custom_sp.h levenshtein.h
	$(CC) $(CFLAGS) custom_sp.cpp

simple_sp.o: simple_sp.cpp simple_sp.h levenshtein.h
	$(CC) $(CFLAGS) simple_sp.cpp

levenshtein.o: levenshtein.cpp levenshtein.h
	$(CC) $(CFLAGS) levenshtein.cpp

Test/levenshtein_test.o: Test/levenshtein_test.cpp levenshtein.h levenshtein.cpp
	$(CC) $(CFLAGS) Test/levenshtein_test.cpp -o Test/levenshtein_test.o

main.o: main.cpp simple_sp.h levenshtein.h
	$(CC) $(CFLAGS) main.cpp

main: main.o levenshtein.o simple_sp.o
	$(CC) $(LFLAGS) $(PROFILER) main.o simple_sp.o levenshtein.o -o main


fast.o: fast.cpp
	$(CC) $(CFLAGS) fast.cpp

fast: fast.o levenshtein.o custom_sp.o
	$(CC) $(LFLAGS) $(PROFILER) fast.o custom_sp.o levenshtein.o -o fast


google_test.o: google_test.cpp
	$(CC) $(CFLAGS) google_test.cpp

test: google_test.o levenshtein.o Test/levenshtein_test.o
	$(CC) $(LFLAGS) google_test.o levenshtein.o Test/levenshtein_test.o -o test

clean:
	\rm *.o test Test/*.o main fast
